@echo off
title Cyan-Note Backend - Starting with Maven Wrapper
echo.
echo ====================================
echo   Cyan-Note Backend Startup
echo   Using Maven Wrapper (No Maven installation required)
echo ====================================
echo.

echo [INFO] Java Environment:
echo JAVA_HOME: %JAVA_HOME%
echo.

echo [INFO] Java Version:
java -version
echo.

echo [INFO] Starting application with Maven Wrapper...
echo This will automatically download Maven if needed.
echo.

REM Use Maven Wrapper instead of mvn
call mvnw.cmd clean compile

if %ERRORLEVEL% neq 0 (
    echo [ERROR] Compilation failed
    pause
    exit /b 1
)

echo [INFO] Starting Spring Boot application...
call mvnw.cmd spring-boot:run -Dspring.profiles.active=dev

echo [INFO] Application stopped
pause